The peer-to-peer (P2P) network technology, as the technical drive for next generation services, is expected to improve the technical performance of P2P applications under limited hardware resources while developing new services. During the content sharing, some large shared contents are divided into blocks to ensure the content sharing efficiency and utilize the terminal performance. In this way, a terminal may obtain content blocks according to the actual requirements. The content may be divided into blocks by size or by the time when the content is transmitted. The latter method is widely applied in the content division of streaming media.
When the content source peer transfers a content block to the content receiving peer, the meta information of the content block is also transferred to the content receiving peer. The Meta information may include the location where the content block is located in the whole content. Upon receipt of enough content blocks, the content receiving peer may arrange the content blocks according to the location information of each content block so as to recover the original content.
Currently, the original content is divided into blocks by using the linear packet coding scheme. FIG. 1 shows the process of transmitting shared contents in the prior art. The process includes the following steps:                01. The content source peer divides the original content into n blocks according to the size of the original content. Each content block is represented as B1, B2, . . . , Bn.        02. The content source peer constructs m n-dimensional coefficient vectors. m is equal to or greater than n, and any n n-dimensional coefficient vectors are of linear independence.        03. The content source peer combines the m n-dimensional coefficient vectors with n content blocks linearly to obtain m linear code blocks, namely, C1, C2, . . . , Cm.        
This step may be indicated by the following formula:
                    C        =                ⁢                  A          ×          B                                        =                ⁢                              [                                                                                                      a                      11                                        ,                                                                                                              a                      12                                        ,                                                                                                              a                      13                                        ,                                                                                        …                    ,                                                                                        a                                          1                      ⁢                      n                                                                                                                                                              a                      21                                        ,                                                                                                              a                      22                                        ,                                                                                                              a                      23                                        ,                                                                                        …                    ,                                                                                        a                                          2                      ⁢                      n                                                                                                                                                              a                      31                                        ,                                                                                                              a                      32                                        ,                                                                                                              a                      33                                        ,                                                                                        …                    ,                                                                                        a                                          3                      ⁢                      n                                                                                                                                                                                                                                                                                                    ⋮                                                                                                                                                                                                                                                                                                        a                                              n                        ⁢                                                                                                  ⁢                        1                                                              ,                                                                                                              a                                              n                        ⁢                                                                                                  ⁢                        2                                                              ,                                                                                                              a                                              n                        ⁢                                                                                                  ⁢                        3                                                              ,                                                                                        …                    ,                                                                                        a                    nn                                                                                                                                                                                                                                                                                ⋮                                                                                                                                                                                                                                                                                                        a                                              m                        ⁢                                                                                                  ⁢                        1                                                              ,                                                                                                              a                                              m                        ⁢                                                                                                  ⁢                        2                                                              ,                                                                                                              a                                              m                        ⁢                                                                                                  ⁢                        3                                                              ,                                                                                        …                    ,                                                                                        a                    mn                                                                        ]                    ×                      [                                                                                B                    1                                                                                                                    B                    2                                                                                                                    B                    3                                                                                                ⋮                                                                              ⋮                                                                              ⋮                                                                                                  B                    n                                                                        ]                                                  =                ⁢                  [                                                                      C                  1                                                                                                      C                  2                                                                                                      C                  3                                                                                    ⋮                                                                                      C                  n                                                                                    ⋮                                                                                      C                  m                                                              ]                    
A is a coefficient matrix composed of m n-dimensional coefficient vectors. Any n n-dimensional coefficient vectors are of linear independence.
04. The content receiving peer sends a content download request that carries a content ID to the content transmitting peer.
In this step, the content transmitting peer may be the content source peer or a content terminal that has downloaded code blocks from the content source peer or other content transmitting peers.
05. After receiving the content download request, the content transmitting peer sends the stored coefficient vectors corresponding to the content ID carried in the request to the content receiving peer.
06. The content receiving peer compares the coefficient vectors received from the content transmitting peer with the downloaded coefficient vectors corresponding to the content ID.
07. The content receiving peer downloads the code blocks from the content transmitting peer according to the coefficient vectors stored by the content transmitting peer but not downloaded by the content receiving peer. Taking coefficient vector a among all coefficient vectors received from the content transmitting peer as an example, if the coefficient vectors corresponding to the content ID that are downloaded by the content receiving peer do not include coefficient vector a, the content receiving peer determines that the code block corresponding to coefficient vector a is not downloaded, and may download this code block from the content transmitting peer. A code block that the content receiving peer downloads from the content source peer includes block property and block data. The block property includes a content ID, a coefficient vector, a block size and a block checksum.
08. The content receiving peer determines that n code blocks are downloaded, and constructs a linear equation with n unknowns according to n code blocks and n n-dimensional coefficient vectors. The content receiving peer obtains n content blocks of the original content by computing this equation.
09. The content receiving peer obtains the original content according to the n content blocks. Meanwhile, the content receiving peer shares the code blocks that are downloaded from the content transmitting peer.
As seen from FIG. 1, the prior art has the following drawbacks:                1. When the content receiving peer queries the content transmitting peer for the required code blocks and downloads the code blocks from the content transmitting peer, the content transmitting peer must transfer the coefficient vectors corresponding to the code blocks to the content receiving peer. This may occupy large bandwidth resources if there are high dimensional coefficient vectors.        2. When the content receiving peer determines to download code blocks from the content transmitting peer, the content receiving peer must compare the coefficient vectors stored by the content transmitting peer with the downloaded coefficient vectors to determine what code blocks need to be downloaded from the content transmitting peer. This may take a long time when there are high dimensional coefficient vectors, thus increasing the duration of obtaining the original content and reducing the sharing speed.        3. The combination of code blocks and original content blocks looses the linear coding property. Therefore, the original content blocks cannot be shared, and the original content and code blocks must be reserved after the content receiving peer recovers the original content. This wastes huge space resources.        4. When the coefficient vectors are constructed, the coefficient vectors only need to satisfy the condition that any n n-dimensional coefficient vectors are of linear independence. Therefore, it may take the content receiving peer a long time to compute the equation when complex coefficient vectors are constructed, thus decreasing the sharing efficiency.        